<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<?php echo base_url().'images/favicon.ico';?>" />
<style type="text/css">@import url("<?php echo base_url() . 'css/reset.css'; ?>");</style>
<style type="text/css">@import url("<?php echo base_url() . 'css/login.css'; ?>");</style>
<title>Login</title>
</head>

<body>
<div id="login_box">
	
	<h1>Login Koperasi</h1>
	
	<?php
		$attributes = array('name' => 'login_form', 'id' => 'login_form');
		echo form_open('login/process_login', $attributes);
	?>
		
		<?php 
			$message = $this->session->flashdata('message');
			echo $message == '' ? '' : '<p id="message">' . $message . '</p>';
		?>
		
		<p>
			<label for="user_name">Username:</label>
			<input type="text" name="user_name" size="20" class="form_field" value="<?php echo set_value('user_name');?>"/>			
		</p>
		<?php echo form_error('user_name', '<p class="field_error">', '</p>');?>
		
		<p>
			<label for="password">Password:</label>
			<input type="password" name="password" size="20" class="form_field" value="<?php echo set_value('password');?>"/>			
		</p>
		<?php echo form_error('password', '<p class="field_error">', '</p>');?>
			
		<p>
		<label for="id_cabang">login sebagai:</label>
		<?php // Data Cabang
			$cabang = $this->Cabang_model->get_cabang()->result();
			foreach($cabang as $row)
			{
				$options_cabang[$row->id_cabang] = $row->cabang;
			} ?>
        <?php echo form_dropdown('id_cabang', $options_cabang, isset($default['id_cabang']) ? $default['id_cabang'] : ''); ?>
	</p>
	<?php echo form_error('id_cabang', '<p class="field_error">', '</p>');?>
		
		<p>
			<input type="submit" name="submit" id="submit" value="Login" />
		</p>
	</form>
</div>
</body>
</html>